<?php

include('inicializar.php');
include('validar_sesion.php');
if ($logueado) {
    switch ($rolUsuario['Rol']) {
        case '1': {
                header("Location:../administracion/aprobarRegistroUsuario.php");
                break;
            }
        case '2': {
                header("Location:../transacciones/historico.php");
                break;
            }
    }
}
?>

<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta charset="utf-8">
        <title>Contact Page - Travel by templatemo</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <meta name="author" content="templatemo">
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800,700,600,300' rel='stylesheet' type='text/css'>

        <link rel="stylesheet" href="../resources/css/bootstrap.min.css">
        <link rel="stylesheet" href="../resources/css/font-awesome.css">
        <link rel="stylesheet" href="../resources/css/animate.css">
        <link rel="stylesheet" href="../resources/css/templatemo_misc.css">
        <link rel="stylesheet" href="../resources/css/templatemo_style.css">

        <script src="../resources/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
    </head>
    <body>



        <div class="site-header">
            <div class="container">
                <div class="main-header">
                    <div class="row">
                        <div class="col-md-4 col-sm-6 col-xs-10">
                            <div class="logo">
                                <a rel="nofollow" href="http://www.templatemo.com/preview/templatemo_409_travel">
                                    <img src="../resources/images/logoBanqueaChevere.png" alt="travel by templatemo" title="travel - free html5 template">
                                </a>
                            </div> <!-- /.logo -->
                        </div> <!-- /.col-md-4 -->
                        <div class="col-md-8 col-sm-6 col-xs-2">
                            <div class="main-menu">
                                <ul class="visible-lg visible-md">
                                    <li><a href="../index.php">Home</a></li>
                                    <li  class="active"><a href="#">Ingreso</a></li>
                                    <li><a href="registro.php">Registro</a></li>
                                    <li><a href="contacto.php">Contáto</a></li>     
                                </ul>
                                <a href="#" class="toggle-menu visible-sm visible-xs">
                                    <i class="fa fa-bars"></i>
                                </a>
                            </div> <!-- /.main-menu -->
                        </div> <!-- /.col-md-8 -->
                    </div> <!-- /.row -->
                </div> <!-- /.main-header -->
                <div class="row">
                    <div class="col-md-12 visible-sm visible-xs">
                        <div class="menu-responsive">
                            <ul>
                                <li><a href="../index.php">Home</a></li>
                                <li><a href="services.html">Services</a></li>
                                <li><a href="events.html">Events</a></li>
                                <li><a href="about.html">About Us</a></li>
                                <li class="active"><a href="contact.html">Contact</a></li>
                            </ul>
                        </div> <!-- /.menu-responsive -->
                    </div> <!-- /.col-md-12 -->
                </div> <!-- /.row -->
            </div> <!-- /.container -->
        </div> <!-- /.site-header -->

        <div class="page-top" id="templatemo_contact">
        </div> <!-- /.page-header -->

        <div class="contact-page">
            <div class="container">
                <div class="row">

                    <div class="col-md-5 col-sm-6">
                        <h3 class="widget-title">Ingreso</h3>
                        <div class="contact-form">
                            <form name="ajaxform" id="ajaxform" action="../php/login.php" method="post">
                                <p>
                                    <input type="text" name="username" placeholder="Username" required>         
                                </p>
                                <p>
                                    <input type="password" name="pass" placeholder="Password" required>
                                </p>

                                <p>
                                    <input type="checkbox" name="rememberMe"> Remember me
                                </p>
                                <div id="mensaje"/>
                                <input type="submit" class="mainBtn" id="submit" value="Ingresar">
                            </form>
                        </div> <!-- /.contact-form -->
                    </div>
                </div>
            </div>
        </div>




        

        <div class="site-footer">
            <div class="container">
                <div class="row">
                    <div class="col-md-4 col-sm-4">
                        <div class="footer-logo">
                            <a href="index.html">
                                <img src="../resources/images/logoBanqueaChevere.png" alt="">
                            </a>
                        </div>
                    </div> <!-- /.col-md-4 -->
                    <div class="col-md-4 col-sm-4">
                        <div class="copyright">
                            <span>Copyright &copy; 2084 <a href="#">Company Name</a> - <a rel="nofollow" href="http://www.templatemo.com/preview/templatemo_409_travel">Travel</a> by <a rel="nofollow" href="http://www.templatemo.com">templatemo</a></span>
                        </div>
                    </div> <!-- /.col-md-4 -->
                    <div class="col-md-4 col-sm-4">
                        <ul class="social-icons">
                            <li><a href="#" class="fa fa-facebook"></a></li>
                            <li><a href="#" class="fa fa-twitter"></a></li>
                            <li><a href="#" class="fa fa-linkedin"></a></li>
                            <li><a href="#" class="fa fa-flickr"></a></li>
                            <li><a href="#" class="fa fa-rss"></a></li>
                        </ul>
                    </div> <!-- /.col-md-4 -->
                </div> <!-- /.row -->
            </div> <!-- /.container -->
        </div> <!-- /.site-footer -->
        <script src="../resources/js/vendor/jquery-1.11.0.min.js"></script>
        <script>window.jQuery || document.write('<script src="../resources/js/vendor/jquery-1.11.0.min.js"><\/script>')</script>
        <script src="../resources/js/bootstrap.js"></script>
        <script src="../resources/js/plugins.js"></script>
        <script src="../resources/js/main.js"></script>


        <script>
            $("#ajaxform").submit(function(e)
            {
                var postData = $(this).serializeArray();
                var formURL = $(this).attr("action");
                $.ajax(
                        {
                            url: formURL,
                            type: "POST",
                            data: postData,
                            success: function(data, textStatus, jqXHR)
                            {
                                if(data==="OK")
                                    location.href="../secure_index.php";
                                else 
                                alert(data);
                                
                            },
                            error: function(jqXHR, textStatus, errorThrown)
                            {
                                //if fails      
                            }
                        });
                e.preventDefault(); //STOP default action
                e.unbind(); //unbind. to stop multiple form submit.
            });


        </script>

    </body>
</html>